home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ifp1s155.zip / PAGE_07.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-21  |  5KB  |  218 lines

  1. unit page_07;
  2.  
  3. interface
  4.  
  5. uses crt, ifpglobl, ifpcomon;
  6.  
  7. procedure page07;
  8.  
  9. implementation
  10.  
  11. procedure page07;
  12.  
  13. const
  14.   mouseint = $33;
  15.   mouselang: array [0..8] of string[10] = ('English', 'French', 'Dutch',
  16.           'German', 'Swedish', 'Finnish', 'Spanish', 'Portuguese', 'Italian');
  17.  
  18. var
  19.   xbyte : byte;
  20.   xword1 : word;
  21.   xword2 : word;
  22.   jsfound: boolean;
  23.   eqjs: boolean;
  24.   oldx, oldy, oldattr: byte;
  25.   xlong: longint;
  26.  
  27.   begin
  28.   caption2('Keyboard');
  29.   Writeln;
  30.   caption3('BIOS support for enhanced keyboard');
  31.   with regs do
  32.     begin
  33.     AH:=$02;
  34.     Intr($16, regs);
  35.     xbyte:=AL;
  36.     AX:=$1200 + xbyte xor $FF;
  37.     Intr($16, regs);
  38.     if AL = xbyte then
  39.       begin
  40.       Write('yes');
  41.       caption3('Enhanced keyboard present');
  42.       yesorno(Mem[BIOSdseg : $0096] and $10 = $10)
  43.       end
  44.     else
  45.       Writeln('no');
  46. (*  PC Magazine 6:15 p.378  *)
  47.     AH:=$02;
  48.     Intr($16, regs);
  49.     offoron('Insert     ', AL and $80 = $80);
  50.     offoron('Caps Lock  ', AL and $40 = $40);
  51.     offoron('Num Lock   ', AL and $20 = $20);
  52.     offoron('Scroll Lock', AL and $10 = $10)
  53.     end;
  54.   caption3('Buffer start');
  55.   xword1:=Memw[BIOSdseg : $0080];
  56.   segofs(BIOSdseg, xword1);
  57.   caption3(' end');
  58.   xword2:=Memw[BIOSdseg : $0082];
  59.   segofs(BIOSdseg, xword2);
  60.   caption3(' size (keystrokes)');
  61.   Writeln((xword2 - xword1) shr 1 - 1);
  62.   caption2('Internal modem [IBM Convertible]/serial printer [PCjr]');
  63.   yesorno(equip and $2000 = $2000);
  64.   caption2('Game port');
  65.   xword:=0;
  66.   jsfound:=false;
  67.   Port[$201]:=1;
  68.   if Port[$201] and $F <> $F then
  69.     jsfound:=false
  70.   else
  71.     repeat
  72.       if (Port[$201] and $F) <> $F then
  73.         jsfound:=true;
  74.       Inc(xword);
  75.     until (xword = $F00) or jsfound;
  76.   if jsfound then
  77.     Write('yes, and ')
  78.   else
  79.     Write('no, and ');
  80.   if (equip and $1000) <> $1000 then
  81.     Write('NOT')
  82.   else
  83.     Write('IS');
  84.   Writeln(' set in BIOS equipment word');
  85.   caption2('Mouse');
  86.   with regs do
  87.     begin
  88.     oldx:=WhereX;
  89.     oldy:=WhereY;
  90.     oldattr:=TextAttr;
  91.     TextColor(LightRed + Blink);
  92.     Write('** Searching for Mouse **');
  93.     TextAttr:=oldattr;
  94.     GotoXY(oldx, oldy);
  95.     AX:=$0021;
  96.     Intr(mouseint, regs);
  97.     ClrEol;
  98.     if AX = $FFFF then
  99.       begin
  100.       Write('yes');
  101.       caption3('Buttons');
  102.       if BX = $FFFF then
  103.         BX:=2;
  104.       Writeln(BX);
  105.       AX:=$0070;
  106.       BX:=$ABCD;
  107.       Intr(mouseint, regs);
  108.       if (AX = $ABCD) and (MemW[BX:CX] = $ABCD) and
  109.         (MemW[BX:CX + 8] = $ABCD) then
  110.         begin
  111.         caption3('Mouse Systems version');
  112.         xword:=MemW[MemW[BX:CX + 4]:MemW[BX:CX + 2]];
  113.         Writeln(Hi(xword), decimal, addzero(Lo(xword)));
  114.         end;
  115.       AX:=$266C;
  116.       BX:=0;
  117.       CX:=0;
  118.       Intr(mouseint, regs);
  119.       if BX = $5353 {SS} then
  120.         begin
  121.         caption3('Logitech version');
  122.         Write(Chr(CH), decimal, Chr(CL), 'x');
  123.         if Chr(CH) >= '4' then
  124.           begin
  125.           caption3('Ballistics');
  126.           AX:=$1F6C;
  127.           BX:=0;
  128.           CX:=0;
  129.           Intr(mouseint, regs);
  130.           if BX = 0 then
  131.             Write('off')
  132.           else
  133.             case CX of
  134.               1: Write('low');
  135.               2: Write('high')
  136.             else
  137.               Write('???');
  138.             end;
  139.           caption3('Hand');
  140.           AX:=$216C;
  141.           BX:=0;
  142.           Intr(mouseint, regs);
  143.           if BX = 0 then
  144.             Writeln('right')
  145.           else
  146.             Writeln('left')
  147.           end;
  148.         end;
  149.       caption3('Microsoft version standard');
  150.       AX:=$0024;
  151.       Intr(mouseint, regs);
  152.       if AX < $FFFF then
  153.         begin
  154.         Writeln(BH, decimal, addzero(unbcd(BL)));
  155.         caption3('Type');
  156.         case CH of
  157.           $01 : Write('bus');
  158.           $02 : Write('serial');
  159.           $03 : Write('InPort');
  160.           $04 : Write('PS/2');
  161.           $05 : Write('HP')
  162.           else
  163.             unknown('mouse', CH, 2)
  164.         end;
  165.         caption3('Interrupt');
  166.         case CL of
  167.           $00 : Writeln('PS/2');
  168.           $02..$05, $07 : Writeln('IRQ', CL)
  169.           else
  170.             unknown('interrupt', CL, 2)
  171.         end;
  172.       caption3('EGA register support');
  173.       AH:=$FA;
  174.       BX:=0;
  175.       Intr($10, regs);
  176.         if BX <> 0 then
  177.         begin
  178.         Write('yes');
  179.         caption3('version');
  180.         Writeln(unbcd(Mem[ES:BX]), decimal, addzero(unbcd(Mem[ES:BX+1])))
  181.         end
  182.       else
  183.         Writeln('no');
  184.       caption3('Save state buffer size (bytes)');
  185.       AX:=$0015;
  186.       Intr(mouseint, regs);
  187.       Writeln(BX);
  188.       caption3('Mickeys/pixel (horizontal)');
  189.       AX:=$001B;
  190.       Intr(mouseint, regs);
  191.       Write(BX : 5);
  192.       caption3(' (vertical)');
  193.       Writeln(CX : 5);
  194.       caption3('Double speed threshold');
  195.       Writeln(DX);
  196.       caption3('Current display page');
  197.       AX:=$001E;
  198.       Intr(mouseint, regs);
  199.       Writeln(BX);
  200.       caption3('Language');
  201.       AX:=$0023;
  202.       Intr(mouseint, regs);
  203.       if AX < $FFFF then
  204.         if BX < 9 then
  205.           Writeln(mouselang[BX])
  206.         else
  207.           unknown('language', BX, 4)
  208.       else
  209.         Writeln('N/A');
  210.         end
  211.       else
  212.         dontknow
  213.       end
  214.     else
  215.       Writeln('no')
  216.     end
  217.   end;
  218. end.